<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
	<Frame name="ScrapVisualizer" parent="MerchantFrame" inherits="ButtonFrameTemplate" hidden="true">
		<Anchors>
			<Anchor point="BOTTOMLEFT" x="13" y="61"/>
			<Anchor point="TOPRIGHT" x="-34" y="-13"/>
		</Anchors>
		
        <Frames>
       		<Button name="$parentTab1" inherits="TabButtonTemplate" id="1">
				<Anchors>
					<Anchor point="TOPLEFT" x="70" y="-30"/>
				</Anchors>
				<Scripts>
					<OnClick>
						PanelTemplates_SetTab(ScrapVisualizer, 1)
						ScrapVisualizer:UpdateList()						
					</OnClick>
				</Scripts>
			</Button>
			<Button name="$parentTab2" inherits="TabButtonTemplate" id="2">
				<Anchors>
					<Anchor point="LEFT" relativeTo="$parentTab1" relativePoint="RIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick>
						PanelTemplates_SetTab(ScrapVisualizer, 2)
						ScrapVisualizer:UpdateList()	
					</OnClick>
				</Scripts>
			</Button>
        
			<ScrollFrame parentKey = 'scroll' name="$parentScroll" inherits="HybridScrollFrameTemplate">
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="$parentInset" x="4" y="-4"/>
					<Anchor point="BOTTOM" relativeTo="$parentInset" x="-9" y="4"/>
				</Anchors>
				<Frames>
					<Slider name="$parentBar" inherits="HybridScrollBarTemplate">
						<Anchors>
							<Anchor point="TOPLEFT" relativePoint="TOPRIGHT" x="-1" y="-12"/>
							<Anchor point="BOTTOMLEFT" relativePoint="BOTTOMRIGHT" x="-1" y="11"/>
						</Anchors>
					</Slider>
				</Frames>
			</ScrollFrame>
			<Button parentKey = "button" name="$parentButton" hidden = "true" inherits="MagicButtonTemplate">
				<Anchors>
					<Anchor point="BOTTOMRIGHT"/>
				</Anchors>
				<Scripts>
					<OnClick>
						ScrapVisualizer.selectionType = nil
						Scrap:ToggleJunk(ScrapVisualizer.selection)
					</OnClick>
				</Scripts>
			</Button>
		</Frames>
		<Layers>
			<Layer level="OVERLAY">
				<FontString parentKey="loading" inherits="GameFontHighlightLarge">
					<Anchors>
						<Anchor point="CENTER" relativeTo="$parentInset"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
	</Frame>
	
	<Button name="ScrapVisualizer_ButtonTemplate" virtual="true">
		<Size>
			<AbsDimension x="295" y="17"/>
		</Size>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture parentKey="stripe">
					<Anchors>
						<Anchor point="TOPLEFT" x="1" y="0"/>
						<Anchor point="BOTTOMRIGHT" x="-1" y="0"/>
					</Anchors>
					<Color a=".08" r="1" g="1" b="1"/>
				</Texture>
			</Layer>
			
			<Layer level="BORDER">
				<Texture parentKey="icon">
					<Size>
						<AbsDimension x="15" y="15"/>
					</Size>
					<Anchors>
						<Anchor point="RIGHT" x="-20" y="0"/>
					</Anchors>
				</Texture>
				<FontString parentKey="text" inherits="GameFontHighlightLeft">
					<Size>
						<AbsDimension x="210" y="11"/>
					</Size>
					<Anchors>
						<Anchor point="LEFT" x="11" y="0"/>
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		
		<Scripts>
			<OnClick>
				ScrapVisualizer.selectionType = ScrapVisualizer.selectedTab
				ScrapVisualizer.selection = self.item
				ScrapVisualizer.scroll:update()
				ScrapVisualizer:UpdateButton()
			</OnClick>
			<OnEnter>
				GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
				GameTooltip:SetHyperlink(self.link)
				GameTooltip:Show()
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide()
			</OnLeave>
		</Scripts>
		
		<HighlightTexture file="Interface\QuestFrame\UI-QuestTitleHighlight" alphaMode="ADD"/>
	</Button>
</Ui>